{# Every post, filtered by status; a row opens its editor in the drawer. Publish and archive answer with ``data-api-done``: the toast says what happened and the page reloads where it was, filter and all. #} {% from "components/macros/layout.html" import card, chip, drawer_sync %} {% from "components/macros/table.html" import data_table %} {% from "components/macros/form.html" import action %} {% macro row_actions(row) -%} {% if row.is_published %} {{ action("Archive", 'hx-post="' ~ partials ~ '/posts/' ~ row.id ~ '/archive" hx-swap="none" data-api-done="Archived"', "danger") }} {% else %} {{ action("Publish", 'hx-post="' ~ partials ~ '/posts/' ~ row.id ~ '/publish" hx-swap="none" data-api-done="Published"', "primary") }} {% endif %} {%- endmacro %}